<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>v-text指令</title>
    <!-- 引入Vue.js -->
    <script src="../js/vue.js"></script>
  </head>
  <body>
    <!-- 准备好一个容器 -->
    <div id="root">
      <div>你好,{{name}}</div>
      <div v-text="name">你好</div>
      <!-- v-text="xx" 会将标签的内容替换为xx -->
      <!-- 不支持解析标签 -->
      <div v-text="str"></div> <!-- <h3>你好呀！</h3> -->>
    </div>
  </body>
  <script>
    const vm = new Vue({
      el: "#root",
      data() {
        return {
          name: "张老三",
          str:"<h3>你好呀！</h3>"
        };
      },
    });
  </script>
</html>
